Add a "Select All" menuitem. (#156792, Paolo Borelli)
authorMatthias Clasen <mclasen@redhat.com>
Sat, 30 Oct 2004 04:13:24 +0000 (04:13 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 30 Oct 2004 04:13:24 +0000 (04:13 +0000)
2004-10-30  Matthias Clasen  <mclasen@redhat.com>

* tests/testtext.c: Add a "Select All" menuitem.  (#156792,
Paolo Borelli)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/testtext.c

index f8b37af575148a0a6f8a9c8b68860044dd71c3e5..2388ca097ba34d399b810a940b61c2f0cce3cf74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-10-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testtext.c: Add a "Select All" menuitem.  (#156792,
+       Paolo Borelli)
+
        * gtk/gtkicontheme.c (insert_theme): Sort the dir_mtimes 
        list in the same way as the search path.
        (theme_subdir_load): Avoid stat()ing subdirs if the theme 
index f8b37af575148a0a6f8a9c8b68860044dd71c3e5..2388ca097ba34d399b810a940b61c2f0cce3cf74 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testtext.c: Add a "Select All" menuitem.  (#156792,
+       Paolo Borelli)
+
        * gtk/gtkicontheme.c (insert_theme): Sort the dir_mtimes 
        list in the same way as the search path.
        (theme_subdir_load): Avoid stat()ing subdirs if the theme 
index f8b37af575148a0a6f8a9c8b68860044dd71c3e5..2388ca097ba34d399b810a940b61c2f0cce3cf74 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testtext.c: Add a "Select All" menuitem.  (#156792,
+       Paolo Borelli)
+
        * gtk/gtkicontheme.c (insert_theme): Sort the dir_mtimes 
        list in the same way as the search path.
        (theme_subdir_load): Avoid stat()ing subdirs if the theme 
index f8b37af575148a0a6f8a9c8b68860044dd71c3e5..2388ca097ba34d399b810a940b61c2f0cce3cf74 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testtext.c: Add a "Select All" menuitem.  (#156792,
+       Paolo Borelli)
+
        * gtk/gtkicontheme.c (insert_theme): Sort the dir_mtimes 
        list in the same way as the search path.
        (theme_subdir_load): Avoid stat()ing subdirs if the theme 
index 80fc9bbb6be185fc59a955c06b41fadb54a607e9..a33c90703d4d132ae14c07d6292bfa1626bebbd3 100644 (file)
@@ -1232,6 +1232,21 @@ do_search (gpointer callback_data,
   gtk_widget_show_all (dialog);
 }
 
+static void
+do_select_all (gpointer callback_data,
+               guint callback_action,
+               GtkWidget *widget)
+{
+  View *view = view_from_widget (widget);
+  GtkTextBuffer *buffer;
+  GtkTextIter start, end;
+
+  buffer = view->buffer->buffer;
+
+  gtk_text_buffer_get_bounds (buffer, &start, &end);
+  gtk_text_buffer_select_range (buffer, &start, &end);
+}
+
 typedef struct
 {
   /* position is in coordinate system of text_view_move_child */
@@ -1511,6 +1526,7 @@ static GtkItemFactoryEntry menu_items[] =
 
   { "/_Edit", NULL, 0, 0, "<Branch>" },
   { "/Edit/Find...", NULL, do_search, 0, NULL },
+  { "/Edit/Select All", "<control>A", do_select_all, 0, NULL }, 
 
   { "/_Settings",        NULL,         NULL,             0, "<Branch>" },
   { "/Settings/Wrap _Off",   NULL,      do_wrap_changed,  GTK_WRAP_NONE, "<RadioItem>" },